package comjavaday02;

import javax.swing.*;
import java.awt.event.KeyListener;

public class My {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setTitle("作业");
        jf.setBounds(500,50,1100,900);
        My1 jp = new My1();
        jf.add(jp);
        jf.setResizable(false);
        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Thread x=new Thread(jp);
        jf.addKeyListener(jp);
        jf.requestFocus();
        x.start();

    }
}
